import request from '/src/axios.js';
import {baseUrl} from "../../config/env";

export const dictApi = {
  userPage: () => request({
    url: baseUrl + "/api-user/users/userPage",
    method: 'get',
  }),

  ExportDevices: (exportDevices, all, deviceType, keyword, activityId, siteId) => request({
    url: baseUrl + "/api-bureau/gasDevice/exportDevices?isAll=" + all + "&keyword=" + keyword + "&activityId=" + activityId + "&siteId=" + siteId,
    method: 'post',
    data: exportDevices,
    responseType: 'arraybuffer'
  }),

  getDictPage: (current, size, params) => request({
    url: baseUrl + '/api-user/dict/getDictPage',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  }),
  remove: (ids) => request({
    url: baseUrl + '/api-user/dict/remove',
    method: 'post',
    params: {
      ids,
    }
  }),

  create: (row) => request({
    url: baseUrl + '/api-user/dict/create',
    method: 'post',
    data: row
  }),

  update: (row) => request({
    url: baseUrl + '/api-user/dict/update',
    method: 'post',
    data: row
  }),
  detail: (id) => request({
    url: baseUrl + '/api-user/dict/detail',
    method: 'get',
    params: {
      id,
    }
  }),
  getDictTree: () => request({
    url: baseUrl + '/api-user/dict/tree',
    method: 'get'
  })
}


